# 生成二维码
import qrcode

# img = qrcode.make("看你")
# img.save("qrcode.png")

# 操作execl
import xlrd
# 1.打开xlsx文件
xlsx = xlrd.open_workbook("E:\\bit\\pythoncode\\pythonProject2\\test.xlsx")
# 2.获取指定的标签页
table = xlsx.sheet_by_index(0)
# 3.获取表格有多少行
rows = table.nrows
# print(f"rows = {rows}")
# 4.循环统计
total = 0
count = 0
for i in range(1, rows):
    # print(table.cell_value(i, 1))
    # print(table.cell_value(i, 2))
    class_id = table.cell_value(i, 1)
    if class_id == 2:
        count += 1
        total += table.cell_value(i, 2)
print(f"平均分 = {total/count}")





